<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:mj="http://mojarra.dev.java.net/mojarra_ext"> 

<h:head>
	<title>Atribuição de Disciplina a Professor</title>
</h:head> 
<body> 
	<h1>Atribuição de Disciplina</h1>
	
	<h:form>
		<h:panelGrid border="1" columns="2" style="width: 618px; ">

			<h:outputLabel value="Professor: " for="professor"/>
			<h:selectOneMenu id="selectProfessor" value="#{professorBean.professor}" converter="professorConverter">
				<f:selectItem itemValue="" itemLabel="Selecione um professor"/>
				<f:selectItems value="#{professorBean.recuperarTodos()}"/>
			</h:selectOneMenu>

			<h:outputLabel value="Disciplina: " for="disciplina"/>
			<h:selectOneMenu id="selectDisciplina" value="#{disciplinaBean.disciplina}" converter="disciplinaConverter">
				<f:selectItem itemValue="" itemLabel="Selecione uma disciplina"/>
				<f:selectItems value="#{disciplinaBean.recuperarTodas()}"/>
			</h:selectOneMenu>

			<h:commandButton value="Atualizar" action="#{professorBean.adicionarDisciplina(disciplinaBean.disciplina)}" style="width: 163px; "></h:commandButton>
		</h:panelGrid>
	</h:form>
</body> 
</html>
